<?php
if (!defined('ZAZA')) exit('No direct script access allowed');
/**
 * @copyright     ZaZa Group
 * @author        Sir Doan
 */
class Model
{
    public static $current = false; 
    public static $load = false; 
    function __construct()
    {
        self::$current = &$this;
        $classModel = str_replace('_', '', Module::$current->data['module_name']);
        if(file_exists(MODEL_PATH . DS . $classModel .'_model'. EXT))  
        {        
           System::registerFile($classModel .'_model', MODEL_PATH . DS); 
           $classModel .= '_Model';
           self::$load = &new $classModel();
        }  
    }  
    
}  
// Initialize Model
Model::$current = new Model();   
?>
